4 Visually and Interactively Exploring Our Data
Now that we have set admin to be the loaded administrative area data and roads to be the loaded roads data, we can use sf and mapview to plot their geometry on a static or interactive map.
4.1 Static Mapping
Here we need to use st_geometry to generate our static maps on the geometries only, otherwise the sf objects will plot a map for every column of the dataset:

We chose to show the axis axis = T, giving a general idea of what coordinates each state/UT is located at. We also show the polygonal boundaries to give us a look at how large each state/UT is.

Since road data is generally polylines, and we are using all roads without considering their classification (highways, streets, etc), we can simply plot just the lines. This gives us an idea of which areas in India have more roads (are more road dense) than that of others. We can see that most of the south and eastern areas in India are relatively denser (darker portions) than the other areas.
4.2 Web Mapping
In addition to static mapping, we can also use mapview to interactively explore our data. This will let us zoom, pan around, and click on geometric objects to explore them in detail.
It’s pretty cool - try it out!: